﻿using ComicWeb.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ComicWeb.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ComicsInfoController : ControllerBase
    {
        private readonly ShopContext _context;
        //注入依赖
        public ComicsInfoController(ShopContext context)
        {
            _context = context;
        }

        // GET: api/VClassifications
        /// <summary>
        ///随机漫画显示
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<ActionResult<IEnumerable<VComicsInfoSj>>> GetComicsinfo()
        {
            return _context.VComicsInfoSjs;
        }

    }
}
